package org.nuonuo.sdk.model.req;

import org.nuonuo.sdk.jackson.JsonMapper;
import org.nuonuo.sdk.valid.Validator;

import javax.validation.ValidationException;
import java.util.List;

/**
 * @Version 1.0
 * @Author az
 * @Date 2024-04-09 13:36:46
 * @ClassName InvoiceReq
 * @Description
 */

public class InvoiceReq extends Validator {
    /**
     * 发票流水号，两字段二选一，同时存在以流水号为准（最多查50个订单号）
     */
    private List<String> serialNos;

    /**
     * 订单编号（最多查50个订单号）
     */
    private List<String> orderNos;

    /**
     * 是否需要提供明细 1-是, 0-否(不填默认 0)
     */
    private String isOfferInvoiceDetail;

    @Override
    public void valid() {
        if (JsonMapper.isEmpty(serialNos) && JsonMapper.isEmpty(orderNos))
            throw new ValidationException("发票流水号和订单编号两字段二选一");
    }

    public List<String> getSerialNos() {
        return serialNos;
    }

    public void setSerialNos(List<String> serialNos) {
        this.serialNos = serialNos;
    }

    public List<String> getOrderNos() {
        return orderNos;
    }

    public void setOrderNos(List<String> orderNos) {
        this.orderNos = orderNos;
    }

    public String getIsOfferInvoiceDetail() {
        return isOfferInvoiceDetail;
    }

    public void setIsOfferInvoiceDetail(String isOfferInvoiceDetail) {
        this.isOfferInvoiceDetail = isOfferInvoiceDetail;
    }
}
